//
//  NSString+MMGJson2Str.m
//  MyApp
//
//  Created by Don on 2017/8/28.
//  Copyright © 2017年 com.memego. All rights reserved.
//

#import "NSString+MMGJson2Str.h"

@implementation NSString (MMGJson2Str)
+ (NSString *)mmg_json2String:(NSDictionary *)jsonDic {

    NSError *error;
    NSData *jsonData = [NSJSONSerialization dataWithJSONObject:jsonDic
                                                       options:NSJSONWritingPrettyPrinted
                                                         error:&error];
    if(error || jsonData == nil){
        return @"";
    }else{
        NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
        return jsonString;
    }
}
@end
